
**************************************************************************************************
** Title:		Voting at 16: Does Lowering the Voting Age Lead to More Political Engagement?	**
**				Evidence from a Quasi-Experiment in the City of Ghent (Belgium)					**
** Authors:		Dieter Stiers, Marc Hooghe, Ruth Dassonneville									**
** Data set:	Data_for_replication															**
** Date:		December 2019																	**
**************************************************************************************************

/* NOTE: To run the dofile, it is necessary to
install the ado's "rdrobust" and "rddensity"	*/


***Load data
use "Data_for_replication.dta" , clear

set more off

*******************
***Main analyses***
*******************

*** RD analyses (Table 2)
//Collapse data set
collapse (mean) Attention_politics_general Talk_general Knowledge Internal_efficacy External_efficacy Trust Age_16 Age_18, by(Birthdate)
***16-year-olds
*Attention to politics in general
rdrobust Attention_politics_general Age_16 , c(0) all
*Talking about politics with parents/friends
rdrobust Talk_general Age_16 , c(0) all
*Political knowledge
rdrobust Knowledge Age_16 , c(0) all
*Internal political efficacy
rdrobust Internal_efficacy Age_16 , c(0) all
*External political efficacy
rdrobust External_efficacy Age_16 , c(0) all
*Political trust
rdrobust Trust Age_16 , c(0) all

***18-year-olds
*Attention to politics in general
rdrobust Attention_politics_general Age_18 , c(0) all
*Talking about politics with parents/friends
rdrobust Talk_general Age_18 , c(0) all
*Political knowledge
rdrobust Knowledge Age_18 , c(0) all
*Internal political efficacy
rdrobust Internal_efficacy Age_18 , c(0) all
*External political efficacy
rdrobust External_efficacy Age_18 , c(0) all
*Political trust
rdrobust Trust Age_18 , c(0) all

*** RD Plot (Figure 1) ***
//Attention to politics
rdplot Attention_politics_general Age_16 if Age_16>-102&Age_16<102 , c(0) ci(95) shade nbins(102 102) ///
graph_options(scheme(lean1) legend(off) xlabel(-100(50)100) ylabel(0 1) title("16-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f1, replace))	
rdplot Attention_politics_general Age_18 if Age_18>-236&Age_18<236 , c(0) ci(95) shade nbins(236 236) ///
graph_options(scheme(lean1) legend(off) xlabel(-200(100)200) ylabel(0 1) title("18-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f2, replace)) 	
graph combine f1 f2 , scheme(lean1) xsize(7) title("Attention to politics" , size(small)) name(F1, replace)
		
//Talking about politics
rdplot Talk_general Age_16 if Age_16>-152&Age_16<152 , c(0) ci(95) shade nbins(152 152) ///
graph_options(scheme(lean1) legend(off) xlabel(-150(50)150) ylabel(0 1) title("16-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f1, replace))
rdplot Talk_general Age_18 if Age_18>-298&Age_18<298 , c(0) ci(95) shade nbins(298 298) ///
graph_options(scheme(lean1) legend(off) xlabel(-250(250)250) ylabel(0 1) title("18-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f2, replace)) 
graph combine f1 f2 , scheme(lean1) xsize(7) title("Talking about politics" , size(small)) name(F2, replace)
	
//Political knowledge
rdplot Knowledge Age_16 if Age_16>-103&Age_16<103 , c(0) ci(95) shade nbins(103 103) ///
graph_options(scheme(lean1) legend(off) xlabel(-100(50)100) ylabel(0 1) title("16-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f1, replace))
rdplot Knowledge Age_18 if Age_18>-224&Age_18<224 , c(0) ci(95) shade nbins(224 224) ///
graph_options(scheme(lean1) legend(off) xlabel(-200(100)200) ylabel(0 1) title("18-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f2, replace)) 
graph combine f1 f2 , scheme(lean1) xsize(7) title("Political knowledge" , size(small)) name(F3, replace)

//Create Figure 1
graph combine F1 F2 F3 , scheme(lean1) col(1) ysize(10)
//Save Figure
graph export "Figure_1.pdf", as(pdf) replace

****************
***Appendices***
****************

*** Appendix A ***
*Load data
use "Data_for_replication.dta" , clear
*Factor analysis political trust
factor Trust_NatParl Trust_NatGov Trust_politicians Trust_polparties
alpha Trust_NatParl Trust_NatGov Trust_politicians Trust_polparties

*Table A.1
sum Attention_politics_general Talk_general Knowledge Internal_efficacy External_efficacy Trust

*** Appendix B ***
*Load data
use "Data_for_replication.dta" , clear
*Collapse data
collapse (mean) Online Intended Age_16 Age_18, by(Birthdate)
*Analyses Table B.1
//16-year-olds
rdrobust Online Age_16 , c(0) all
rdrobust Intended Age_16 , c(0) all
//18-year-olds
rdrobust Online Age_18 , c(0) all
rdrobust Intended Age_18 , c(0) all

*** Appendix C ***
*Load data
use "Data_for_replication.dta" , clear
***Number of observations (Table C.1)
tab Age_16 if Age_16>-6&Age_16<6
tab Age_18 if Age_18>-6&Age_18<6

***RD models using raw data (Table C.2)
//16-year-olds
rdrobust Attention_politics_general Age_16 , c(0) all
rdrobust Talk_general Age_16 , c(0) all
rdrobust Knowledge Age_16 , c(0) all
rdrobust Internal_efficacy Age_16 , c(0) all
rdrobust External_efficacy Age_16 , c(0) all
rdrobust Trust Age_16 , c(0) all

//18-year-olds
rdrobust Attention_politics_general Age_18 , c(0) all
rdrobust Talk_general Age_18 , c(0) all
rdrobust Knowledge Age_18 , c(0) all
rdrobust Internal_efficacy Age_18 , c(0) all
rdrobust External_efficacy Age_18 , c(0) all
rdrobust Trust Age_18 , c(0) all

***Test for selection bias
*Load data
use "Population_data.dta" , clear
*T-tests (Table C.3)
ttest Age_corr , by(PART)
ttest Sex , by(PART)

*RD participation (Table C.4)
collapse (mean) PART Age_16 Age_18 , by(Birthdate)
rdrobust PART Age_16 , c(0) all
rdrobust PART Age_18 , c(0) all

//Figure C.1
rdplot PART Age_16 if Age_16>-166&Age_16<166 , c(0) ci(95) shade nbins(166 166) ///
graph_options(scheme(lean1) legend(off) xlabel(-150(50)150) ylabel(0(0.2)1) title("16-year-olds") ///
xtitle("Date of birth") name(f1, replace))
rdplot PART Age_18 if Age_18>-318&Age_18<318 , c(0) ci(95) shade nbins(318 318) ///
graph_options(scheme(lean1) legend(off) xlabel(-300(50)300) ylabel(0(0.2)1) title("18-year-olds") ///
xtitle("Date of birth") name(f2, replace)) 
graph combine f1 f2 , scheme(lean1) xsize(7)
graph export "Figure_C.1.pdf", as(pdf) replace

***Falsiciation analysis (Table C.5)
*Load data
use "Data_for_replication.dta" , clear
collapse (mean) Sex Books Expected_education Age_16 Age_18, by(Birthdate)
//16-year-olds
rdrobust Sex Age_16 , c(0) all
rdrobust Books Age_16 , c(0) all
rdrobust Expected_education Age_16 , c(0) all

//18-year-olds
rdrobust Sex Age_18 , c(0) all
rdrobust Books Age_18 , c(0) all
rdrobust Expected_education Age_18 , c(0) all

*** Appendix D ***
*Load data
use "Data_for_replication.dta" , clear
*T-tests
foreach var of varlist Learned_votinglocal Learned_votingnational Learned_laws Learned_rights heardatschool {
ttest `var' , by(testgroup)
}

*** Appendix E ***
*Load data
use "Data_for_replication.dta" , clear
*Collapse data
collapse (mean) Internal_efficacy External_efficacy Trust Age_16 Age_18 , by(Birthdate)
//Internal political efficacy
rdplot Internal_efficacy Age_16 if Age_16>-119&Age_16<119 , c(0) ci(95) shade nbins(119 119) ///
graph_options(scheme(lean1) legend(off) xlabel(-100(50)100) ylabel(0 1) title("16-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f1, replace))
rdplot Internal_efficacy Age_18 if Age_18>-275&Age_18<275 , c(0) ci(95) shade nbins(275 275) ///
graph_options(scheme(lean1) legend(off) xlabel(-250(250)250) ylabel(0 1) title("18-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f2, replace)) 
graph combine f1 f2 , scheme(lean1) xsize(7) title("Internal political efficacy" , size(small)) name(F4, replace)

//External political efficacy
rdplot External_efficacy Age_16 if Age_16>-124&Age_16<124 , c(0) ci(95) shade nbins(124 124) ///
graph_options(scheme(lean1) legend(off) xlabel(-100(50)100) ylabel(0 1) title("16-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f1, replace))
rdplot External_efficacy Age_18 if Age_18>-241&Age_18<241 , c(0) ci(95) shade nbins(241 241) ///
graph_options(scheme(lean1) legend(off) xlabel(-250(250)250) ylabel(0 1) title("18-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f2, replace)) 
graph combine f1 f2 , scheme(lean1) xsize(7) title("External political efficacy" , size(small)) name(F5, replace)
		
//Political trust
rdplot Trust Age_16 if Age_16>-172&Age_16<172 , c(0) ci(95) shade nbins(172 172) ///
graph_options(scheme(lean1) legend(off) xlabel(-150(50)150) ylabel(0 1) title("16-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f1, replace))
rdplot Trust Age_18 if Age_18>-201&Age_18<201 , c(0) ci(95) shade nbins(201 201) ///
graph_options(scheme(lean1) legend(off) xlabel(-200(100)200) ylabel(0 1) title("18-year-olds", size(medsmall)) ///
xtitle("Date of birth") name(f2, replace)) 
graph combine f1 f2 , scheme(lean1) xsize(7) title("Political trust" , size(small)) name(F6, replace)
		
//Create Figure E.1
graph combine F4 F5 F6 , scheme(lean1) col(1) ysize(10)
//Export
graph export "Figure_E.1.pdf", as(pdf) replace

*** Appendix F ***
*Load data
use "Data_for_replication.dta" , clear
*Collapse data
collapse (mean) Attention_politics_general Internal_efficacy Age_16 Age_18 , by(Birthdate)
*Attention to politics
//16-year-olds
rdrobust Attention_politics_general Age_16 , c(0) all
est clear
foreach num of numlist 45(5)180 {
quietly rdrobust Attention_politics_general Age_16 , c(0) all h(`num')
est store m_`num'
}
coefplot m_* , drop(Conventional Robust) scheme(lean1) vertical yline(0) legend(off) msymbol(o) title("") xtitle("Bandwidth")	///
ylabel(0(0.25)0.5) xlabel(0.525 "45" 0.9975 "90" 1.47 "180") xline(0.9975 , lpattern(shortdash))
graph export "Figure_F.1.pdf", as(pdf) replace

//18-year-olds
rdrobust Attention_politics_general Age_18 , c(0) all
est clear
foreach num of numlist 117(11)470 {
quietly rdrobust Attention_politics_general Age_18 , c(0) all h(`num')
est store m_`num'
}
coefplot m_* , drop(Conventional Robust) scheme(lean1) vertical yline(0) legend(off) msymbol(o) title("") xtitle("Bandwidth")	///
ylabel(0(0.1)0.3) xlabel(0.525 "117" 0.9975 "235" 1.47 "470") xline(0.9975 , lpattern(shortdash))
graph export "Figure_F.2.pdf", as(pdf) replace

*18-year-olds internal efficacy
rdrobust Internal_efficacy Age_18 , c(0) all
est clear
foreach num of numlist 162(18)646 {
quietly rdrobust Internal_efficacy Age_18 , c(0) all h(`num')
est store m_`num'
}
coefplot m_* , drop(Conventional Robust) scheme(lean1) vertical yline(0) legend(off) msymbol(o) title("") xtitle("Bandwidth")	///
ylabel(0(0.1)0.2) xlabel(0.525 "162" 0.9975 "290" 1.47 "646") xline(0.9975 , lpattern(shortdash))
graph export "Figure_F.3.pdf", as(pdf) replace

*** Appendix G ***
*Load data
use "Data_for_replication.dta" , clear
*Generated collapsed variables based on voted or non-voted
bysort Birthdate: egen meanvoted=mean(Attention_politics_general) if testvoted==1
bysort Birthdate: egen meannotvoted=mean(Attention_politics_general) if testnotvoted==1
*Analyses
rdrobust meanvoted Age_16 if testvoted==1 , c(0) all 
rdrobust meannotvoted Age_16 if testnotvoted==1 , c(0) all

